-
Notifications
You must be signed in to change notification settings - Fork 4.2k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Start adding lint rules for 40px default size #64410
Conversation
The following accounts have interacted with this PR and/or linked issues. I will continue to update these lists as activity occurs. You can also manually ask me to refresh this list by adding the If you're merging code through a pull request on GitHub, copy and paste the following into the bottom of the merge commit message.
To understand the WordPress project's expectations around crediting contributors, please review the Contributor Attribution page in the Core Handbook. |
Size Change: 0 B Total Size: 1.77 MB ℹ️ View Unchanged
|
'FontSizePicker', | ||
].map( ( componentName ) => ( { | ||
// Falsy `__next40pxDefaultSize` without a non-default `size` prop. | ||
selector: `JSXOpeningElement[name.name="${ componentName }"]:not(:has(JSXAttribute[name.name="__next40pxDefaultSize"][value.expression.value!=false])):not(:has(JSXAttribute[name.name="size"][value.value!="default"]))`, |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Should error
<Component />
<Component __next40pxDefaultSize={ false } />
<Component size="default" />
Should not error
<Component __next40pxDefaultSize />
<Component size="__unstable-default" />
<Component size="small" />
Flaky tests detected in 0fc2b7e. 🔍 Workflow run URL: https://github.com/WordPress/gutenberg/actions/runs/10327521886
|
@mirka is this one ready for review? |
Yes, sorry, forgot to tag reviewers! |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Tests as expected and looks good 👍
🚀
* Start adding lint rules for 40px default size * Make stricter Co-authored-by: mirka <[email protected]> Co-authored-by: tyxla <[email protected]>
Part of #63871
What?
Adds lint rules for
__next40pxDefaultSize
prop adherence on the following components:Why?
These components currently don't have any violations, so this prevents accidental backslides when new instances are newly introduced into the codebase.
Testing Instructions
See code comments.